/* Modern Ista Login Page Styles */
:root {
    /* Ista brand colors extracted from logo */
    --ista-blue-dark: #1f3a5f;
    --ista-blue-medium: #2c4a6b;
    --ista-blue-light: #e8eef5;
    --ista-green-primary: #8bc34a;
    --ista-green-light: #c8e6c9;

    /* Additional colors */
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --background: #f8fafc;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --success-color: var(--ista-green-primary);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: white;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* Background header image */
body::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 300px;
    background: url('../images/bg_header.gif') no-repeat center center;
    background-size: cover;
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
    transform: translateY(-50%);
    animation: slideDown 2s ease-out;
}

/* Main login wrapper */
.login-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.login-container {
    background: var(--ista-blue-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Subtle map background for login container */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/dunaujvaros_map.png') no-repeat center;
    background-size: contain;
    opacity: 0.25;
    z-index: -1;
    border-radius: var(--radius-lg);
}

/* Header section */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container {
    margin-bottom: 1.5rem;
}

.logo {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(var(--shadow-sm));
}

.login-title {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 400;
}

/* Form styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.input-field {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-primary);
    background-color: var(--white);
    transition: all 0.2s ease-in-out;
}

.input-field:focus {
    outline: none;
    border-color: var(--ista-blue-dark);
    box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.1);
}

.input-field:hover {
    border-color: var(--ista-blue-medium);
}

.input-field::placeholder {
    color: var(--text-muted);
}

/* Button styles */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--ista-blue-dark) 0%, var(--ista-blue-medium) 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--ista-blue-medium) 0%, var(--ista-blue-dark) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--ista-green-light);
    border-color: var(--ista-green-primary);
    color: var(--text-primary);
}

.btn-secondary:active {
    background: var(--ista-green-primary);
    color: var(--white);
}

.btn-text {
    position: relative;
    z-index: 1;
}

/* Loading state for buttons */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive design */
@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }

    body::before {
        height: 200px;
    }

    .login-container {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .login-container::before {
        width: 100%;
        height: 100%;
        opacity: 0.2;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .logo {
        max-width: 100px;
    }

    .button-group {
        gap: 1rem;
    }

    .btn {
        min-height: 52px;
        font-size: 1.05rem;
    }
}

@media (max-width: 360px) {
    body::before {
        height: 150px;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-100vh);
        }
        to {
            opacity: 0.3;
            transform: translateY(-50%);
        }
    }

    .login-container {
        padding: 1.5rem 1rem;
    }

    .login-title {
        font-size: 1.25rem;
    }
}

/* Focus visible for accessibility */
.btn:focus-visible,
.input-field:focus-visible {
    outline: 2px solid var(--ista-blue-dark);
    outline-offset: 2px;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;
        --white: #1e293b;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --border-color: #334155;
    }

    body {
        background: linear-gradient(135deg, var(--ista-blue-dark) 0%, var(--background) 100%);
    }

    .login-container {
        border-color: var(--border-color);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    }
}

/* Animation for slide-up effect */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100vh);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation for slide-down effect */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100vh);
    }
    to {
        opacity: 0.6;
        transform: translateY(-50%);
    }
}

.login-container {
    animation: slideUp 2s ease-out;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .input-field {
        border-width: 3px;
    }

    .btn-primary {
        background: var(--ista-blue-dark);
    }

    .btn-secondary {
        border-width: 3px;
    }
}